package com.noahsloan.nutils.streams;

import java.io.IOException;
import java.io.OutputStream;

/**
 * OutputStream that throws an IOException when used.
 * 
 * @author noah
 * 
 */
public class IOExceptionOutputStream extends OutputStream {

	private IOException e;

	public IOExceptionOutputStream(IOException e) {
		this.e = e;
	}

	@Override
	public void write(int b) throws IOException {
		throw e;
	}

	@Override
	public void close() throws IOException {
		throw e;
	}

	@Override
	public void flush() throws IOException {
		throw e;
	}
}
